package com.songhuan.web.controller;
import com.songhuan.web.dto.*;
import com.songhuan.web.dto.query.*;
import com.songhuan.web.entity.*;
import com.songhuan.web.mapper.*;
import com.songhuan.web.service.*;
import com.songhuan.web.tools.dto.*;
import com.songhuan.web.dto.query.OrganizationPagedInput;
import com.songhuan.web.dto.OrganizationDto;
import com.songhuan.web.mapper.OrganizationMapper;
import com.songhuan.web.service.OrganizationService;
import com.songhuan.web.tools.dto.IdInput;
import com.songhuan.web.tools.dto.IdsInput;
import com.songhuan.web.tools.dto.PagedResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import lombok.SneakyThrows;

/**
 * 班级控制器
 */
@RestController()
@RequestMapping("/Organization")
public class OrganizationController {
    @Autowired()
    private OrganizationService _OrganizationService;
    @Autowired()
    private OrganizationMapper _OrganizationMapper;
    /**
     * 班级分页查询
     */
    @RequestMapping(value = "/List", method = RequestMethod.POST)
    @SneakyThrows
    public PagedResult<OrganizationDto> List(@RequestBody OrganizationPagedInput input)  {
        return _OrganizationService.List(input);
    }
     /**
     * 单个班级查询接口
     */
    @RequestMapping(value = "/Get", method = RequestMethod.POST)
    @SneakyThrows
    public OrganizationDto Get(@RequestBody OrganizationPagedInput input) {

        return _OrganizationService.Get(input);
    }
  
    /**
     * 班级创建或则修改
     */
    @RequestMapping(value = "/CreateOrEdit", method = RequestMethod.POST)
    public OrganizationDto CreateOrEdit(@RequestBody OrganizationDto input) throws Exception {
        return _OrganizationService.CreateOrEdit(input);
    }
    /**
     * 班级删除
     */
    @RequestMapping(value = "/Delete", method = RequestMethod.POST)
    public void Delete(@RequestBody IdInput input)
    {
        _OrganizationService.removeById(input.getId());
    }

    /**
     * 班级批量删除
     */
    @RequestMapping(value = "/BatchDelete", method = RequestMethod.POST)
    public void BatchDelete(@RequestBody IdsInput input)
    {
        _OrganizationService.removeByIds(input.getIds());
    }

 
}
